<?php
include_once 'building.php';
include_once 'data_access.php';
include_once 'admin.php';
$data_access=new database_access();
$data_access->connect();
$query="select * from building order by building_periority asc";
$result=mysql_query($query)or die(mysql_error());
$buildin_array=array();

while($row=mysql_fetch_array($result)){
    $building=new building();
    $building->set_id($row['building_id']);
    $building->set_capacity($row['building_capacity']);
    $building->set_pattern($row['building_pattern']);
    $building->set_periority($row['building_periority']);
    $building->set_building_resident_kind($row['building_resident_kind']);
    $buildin_array[]=$building;
   
}
$admin=new admin();
echo $admin->distribute_student($buildin_array);

?>
